package org.lc.stk.model.banks;

import org.hibernate.annotations.Comment;
import org.lc.stk.model.user.Teacher;

import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

/**
 * 教员自己定义的题库
 */
@Entity
@Table(name = "user_banks")
@DiscriminatorValue("4")  // 自定义题库
public class UserBank extends Bank {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "base_bank_id", nullable = false)
    @Comment("在此题库基础上建立的自定义题库，只能是系统题库")
    private Bank bank;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "teacher_id", nullable = false)
    @Comment("教员用户")
    private Teacher teacher;

    public Bank getBank() {
        return bank;
    }

    public void setBank(Bank bank) {
        this.bank = bank;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

}
